package com.jeasonzhao.commons.parser.expression;

public class SyntaxBarackedNode extends SyntaxNode
{
    private SyntaxNode m_subNode = null;
    public SyntaxBarackedNode(SyntaxNode node)
    {
        m_subNode = node;
    }

    public ValuePair eval(IEvalProvider provider)
        throws EvalException
    {
        return null == m_subNode ? null : m_subNode.eval(provider);
    }
    public void replaceVariableName(INameConvertor map)
    {
        if(null!=m_subNode)
        {
            m_subNode.replaceVariableName(map);
        }
    }
    public String getExpression()
        {
            StringBuffer buf=new StringBuffer();
            buf.append('(');
            if(null!=this.m_subNode)
            {
                buf.append(this.m_subNode.getExpression());
            }
            buf.append(')');
            return buf.toString();
    }
}
